import Vue from 'vue'
import VueRouter from 'vue-router'
import App from './App.vue'
import routes from '@/router/router'
import store from '@/store/';
import '@/config/rem'
// import 'amfe-flexible/index.js'
// 全局引入symbol字体图标
import '@/assets/iconfont'
import IconSvg from '@/components/common/IconSvg';
import VueBetterScroll from 'vue2-better-scroll'
Vue.component('icon-svg', IconSvg)

Vue.config.productionTip = false

Vue.use(VueRouter)
Vue.use(VueBetterScroll)
const router = new VueRouter({
  linkActiveClass: 'active',
  linkExactActiveClass: 'active',
  routes,
  mode: 'hash',
  strict: process.env.NODE_ENV !== 'production',
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      if (from.meta.keepAlive) {
        from.meta.savedPosition = document.body.scrollTop;
      }
      return { x: 0, y: to.meta.savedPosition || 0 }
    }
  }
})
new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
